package com.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.RoomBean;
import com.project.mapper.IRoomMapper;
import com.project.service.IRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class RoomServiceImpl implements IRoomService {
    @Autowired
    private IRoomMapper mapper;
    @Override
    public void add(RoomBean room) {
        mapper.insert(room);
    }

    @Override
    public IPage<RoomBean> findByItem(int pageNO, String address) {
        return mapper.findByItem(
                new Page<RoomBean>(pageNO,PAGESIZE),address);
    }
}
